ds_queue_clear

清除给定队列中的所有数据。

语法:

ds_queue_clear(id);


参数 描述
id 要清除的数据结构的id。


返回: N/A(无返回值)


描述

使用此功能,您可以清除给定队列数据结构中的所有数据。这样做破坏数据结构(用ds_queue_destroy才能破坏它)它只擦除它的所有数据并返回一个空的队列。


例如:

if count = 15 && !ds_queue_empty(command_queue)
   {
   ds_queue_clear(command_queue);
   alarm[0] = room_speed;
   ai_count = 0;
   }

The above code checks a variable to see if it has reached a specific value and if it has it clears the ds_queue indexed in the variable "command_queue", sets an alarm, and resets the variable to 0.


上一页: Queues
下一页: ds_queue_empty
© Copyright YoYo Games Ltd. 2018 All Rights Reserved